<?php	
    include_once(dirname(__FILE__). "/../../../managers/class.User_Manager.php");
    include_once(dirname(__FILE__). "/../../../managers/class.Order_Manager.php");
    include_once(dirname(__FILE__). "/../../../managers/class.Identification_Manager.php");
    include_once(dirname(__FILE__). "/../../../managers/class.Parameters_Manager.php");
    include_once(dirname(__FILE__). "/../../../treatments/class.Log.php");

    class TaxonAdministration_Presenter{

        private $user_manager;
        private $order_manager;
        private $param_manager;
        private $taxon_manager;
        
        private $user_id;
        
        //private $order_administrators;

        public function __construct($userId){
            //--initialisation des attibuts
            $this->user_manager = new User_Manager($userId, "../../");
            $this->order_manager = new Order_Manager($userId, "../../");
            $this->param_manager = new Parameters_Manager();
            
            $this->user_id = $userId;
            //$this->order_administrators = array(array());

            Log::ajoutLignePage($userId, "Administration: Orders", "../../");
        }
        
        public function getUserPictureDirectory(){
            return $this->param_manager->getUserPictureDirectory();
        }
        
        public function getOrderPictureDirectory(){
            return $this->param_manager->getOrderPicturesDirectory();
        }
        
        public function getDirTemp(){
               return $this->param_manager->getTempDirectory();
        }
        public function getIfUserIsOrderAdmin($user_id){
            $res = $this->user_manager->getAllOrderAdmin();
            $est_admin = false;
            foreach ($res as $r) {
                if($r['id_user'] == $user_id){
                    $est_admin = true;
                }
            }
            return $est_admin;
        }
        public function getAllOrder(){
            return $this->order_manager->getAllOrders();
        }
        
        public function getSuperFamilleByOrder($order_id){
            $this->taxon_manager = new Identification_Manager($this->user_id, $order_id, "../../");
            return $this->taxon_manager->getSuperFamilleList();
        }
        public function getFamilleList($supFam_id){
            return $this->taxon_manager->getFamilleList($supFam_id);
        }
        public function getSousFamilleList($fam_id, $supFam_id){
            return $this->taxon_manager->getSousFamilleList($fam_id, $supFam_id);
        }
        public function getTribuList($sousFam_id, $fam_id, $supFam_id){
            return $this->taxon_manager->getTribuList($supFam_id, $fam_id, $sousFam_id);
        }
        public function getGenreList($sousFam_id, $fam_id, $supFam_id,$tribu_id){
            return $this->taxon_manager->getGenreList($supFam_id, $fam_id, $sousFam_id,$tribu_id);
        }
        public function getSousGenreList($sousFam_id, $fam_id, $supFam_id,$tribu_id,$genre_id){
            return $this->taxon_manager->getSousGenreList($supFam_id, $fam_id, $sousFam_id,$tribu_id,$genre_id);
        }
    }